var fs = require('fs'); // get the fs module
var http = require('http');
var url = require('url');
var util = require('util');
var apppath = '/Documents/malldetail_workspace/malldetail/assets/3.0';
http.createServer(function(req, res){
    var request = url.parse(req.url);
    var path = apppath + request.pathname;
    res.writeHead(200, {
        'Content-Type': 'text/plain'
    });
	var readstream = fs.createReadStream(path);
    util.pump(readstream, res, function(){
        res.end();
    });
    res.end(util.inspect(request))
    
}).listen(1337, "127.0.0.1");

console.log('Server running at http://127.0.0.1:1337/');
